package com.vavr.checkincms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.vavr.checkincms.domain.data.SystemUserInfoDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * MeetingInfoMapper
 *
 * @since 2024.08
 */
@Mapper
public interface SystemLoginMapper extends BaseMapper<SystemUserInfoDO> {
    @Select(" select operator_id as operatorId, operator_name as operatorName, operator_account as operatorAccount,"
            + " operator_code as operatorCode,tel,start_time as startTime,end_time as endTime,operator_level as operatorLevel "
            + " from  system_user_info where  (operator_account = #{account} and operator_code = #{code} ) or (tel = #{account} and operator_code = #{code} ) ")
    SystemUserInfoDO queryUserInfo(@Param("account") String account, @Param("code") String code);


    @Select(" select operator_id as operatorId, operator_name as operatorName, operator_account as operatorAccount,"
            + " operator_code as operatorCode,tel,start_time as startTime,end_time as endTime,operator_level as operatorLevel "
            + " from  system_user_info where  tel = #{tel}  ")
    SystemUserInfoDO queryUserInfoByTel(@Param("tel") String tel);


    @Select(" select operator_id as operatorId, operator_name as operatorName, operator_account as operatorAccount,"
            + " operator_code as operatorCode,tel,start_time as startTime,end_time as endTime,operator_level as operatorLevel "
            + " from  system_user_info where  operator_account = #{account}  ")
    SystemUserInfoDO queryUserInfoByAccount(@Param("account") String account);
}
